import request from "@/utils/request";

export function list(params) {
    return request({
        url: "/api/halo-dashboard/v1/coupon",
        params
    });
}
export function detail(id) {
    return request({
        url: `/api/halo-dashboard/v1/coupon/${id}`,
        params: { id }
    });
}

export function add(data) {
    return request({
        url: "/api/halo-dashboard/v1/coupon",
        method: "post",
        data
    });
}

export function update(data) {
    return request({
        url: `/api/halo-dashboard/v1/coupon/${data.id}`,
        method: "put",
        data
    });
}

export function remove(id) {
    return request({
        url: `/api/halo-dashboard/v1/coupon/${id}`,
        method: "delete"
    });
}
